<template>
  <div class="video-container">
    <nav-bar :navBarData="navBarData" @clickBarItem="clickBarItem"></nav-bar>
    <div class="content">
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
import NavBar from "../../components/navbar/NavBar.vue";
export default {
  name: "Video",
  components: { NavBar },
  data() {
    return {
      navBarData: [
        { name: "视频", path: "/video/videolist" },
        { name: "MV", path: "/video/mvlist" },
      ],
    };
  },

  mounted() {
    if (!this.$store.state.isLogin) {
      this.$message.error("视频页面只有登录后才能访问哦!");
      this.$router.replace("/home");
    }
  },

  methods: {
    clickBarItem(path) {
      // console.log(path);
      if (path != this.$route.path) {
        this.$router.push(path);
      }
    },
  },
};
</script>

<style lang="less" scoped>
.video-container {
  width: 90%;
  margin: 0 auto;
}
.content {
  margin-top: 20px;
}
</style>